namespace ZFramework.Runtime
{
    public partial class ItemMgr
    {
        private sealed class InternalShowItemInfo : IReference
        {
            private int _serialId;
            private int _itemId;
            private ItemGroup _itemGroup;
            private ShowItemInfo _userData;

            public InternalShowItemInfo()
            {
                _serialId = 0;
                _itemId = 0;
                _itemGroup = null;
                _userData = null;
            }

            public int SerialId
            {
                get { return _serialId; }
            }

            public int ItemId
            {
                get { return _itemId; }
            }

            public ItemGroup ItemGroup
            {
                get { return _itemGroup; }
            }

            public ShowItemInfo UserData
            {
                get { return _userData; }
            }

            public static InternalShowItemInfo Create(int serialId, int itemId, ItemGroup itemGroup,
                ShowItemInfo userData)
            {
                InternalShowItemInfo internalShowItemInfo = ReferencePool.Acquire<InternalShowItemInfo>();
                internalShowItemInfo._serialId = serialId;
                internalShowItemInfo._itemId = itemId;
                internalShowItemInfo._itemGroup = itemGroup;
                internalShowItemInfo._userData = userData;
                return internalShowItemInfo;
            }

            public void Clear()
            {
                _serialId = 0;
                _itemId = 0;
                _itemGroup = null;
                _userData = null;
            }
        }
    }
}
